from fastapi import FastAPI
import uvicorn
from fastapi.middleware.cors import CORSMiddleware
from fastapi.staticfiles import StaticFiles
origins = [
    "*"]
from controller.account import router as router_account
from controller.bill import router as router_bill
from controller.bill_type import router as router_bill_type
from controller.user import router as router_user
from controller.group_table import router as router_group_table
from controller.asset import router as router_asset

app = FastAPI()
app.add_middleware(
    CORSMiddleware,
    allow_origins=origins,
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)
static = StaticFiles(directory="static", html=True)
app.mount("/static", static)


app.include_router(router_account)
app.include_router(router_bill)
app.include_router(router_bill_type)
app.include_router(router_user)
app.include_router(router_group_table)
app.include_router(router_asset)


if __name__ == "__main__":
    uvicorn.run("main:app", reload=True,port=8000)


